package com.jumlabs.services.drive

import java.util.List
import com.jumlabs.data.entities.drive.File
import org.springframework.beans.factory.annotation.Autowired
import com.jumlabs.data.repositories.drive.FileRepository
import org.springframework.transaction.annotation.Transactional


class DriveServiceDB extends DriveService {	
  
  @Autowired
  var fileRepository:FileRepository=_ 
  
  def list(driveId: String): List[File] = { null }

  @Transactional
  def listRootFiles(driveId: String): List[File] = {
		 fileRepository.findRootFiles(driveId);
    }

  def insert(driveId: String, file: File): Unit = {
    
  }

  def insert(parent: File, children: File): Unit = {
    
  }

  def patch(file: File): Unit = {}

  def update(file: File): Unit = {}

  def copy(file: File): Unit = {}

  def touch(file: File): Unit = {}

  def trash(file: File): Unit = {}

  def untrash(file: File): Unit = {}

  def deleteChildren(file: File): Unit = {}

  def getChildren(file: File): Unit = {}

  def insertChildren(file: File): Unit = {}

  def listChildren(fileId: String): List[File] = {
     fileRepository.findByParentId(fileId);
  }

  def deleteParent(file: File): Unit = {}

  def getParent(file: File): Unit = {}

  def insertParent(file: File): Unit = {}

  def listParents(file: File): Unit = {}

}